<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>BT种子转磁力链_BT种子提取ed2k</title>
  <link href="//cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <link href="//cdn.bootcss.com/bootstrap-fileinput/4.3.8/css/fileinput.min.css" rel="stylesheet">
  <style type="text/css">
    body {font-size: 16px;word-break: break-all;}
    img {max-width: 100%; height: auto;}
  </style>
</head>
<body>
<br>
<div class="container">
  <div class="row">
    <div class="col-md-8">
      <h1>BT种子转磁力链</h1>
      <p class="help-block">选择种子文件，点击 解析 按钮</p>
      <form action="/BT/get.php" method="post" target="_blank" enctype="multipart/form-data">
        <input type="file" name="torrent" id="torrent">
      </form>
      <h3 class="js-show fade hidden">结果</h3>
      <div class="js-result"></div>
      <hr class="js-show hidden">
      <h3>声明</h3>
      <p>本web程序仅对用户上传文件按照一定技术规则进行解析和输出，本身不提供和缓存任何内容；</p>
      <h3>联系/源码索取</h3>
      <p>群名称：576k5ZCN5LuA5LmI6ay8</p>
      <p>群号：189574683</p>
      <p>点击加入：<a target="_blank" href="//shang.qq.com/wpa/qunwpa?idkey=f2701214fb5c70ce08107e7206a282927e13ab91ec0780af640c2ad6bd9895c8"><img border="0" src="//pub.idqqimg.com/wpa/images/group.png" alt="576k5ZCN5LuA5LmI6ay8" title="576k5ZCN5LuA5LmI6ay8"></a></p>
    </div>
    <div class="col-md-4">
      <br>
      <div class="panel panel-success">
        <div class="panel-heading">不(gan)许(kuai)点这里</div>    
        <div class="kanna"><a href="//bilibili2rss.bid/anime/5800" title="bilibili2rss" target="_blank"><img src="" alt="康娜是我的"></a></div>
      </div>
    </div>
  </div>
</div>
<hr>
<footer class="container">
  <div class="row">
  	<div class="col-md-12">
      <p class="text-center">
        <a href="http://www.wdssmq.com/test/pinyin.html" title="心声体">心声体生成</a> | 
        <a href="https://github.com/wdssmq/Bilibili2RSS" title="Bilibili2RSS">Bilibili2RSS</a> | 
        <a href="http://www.wdssmq.com" title="沉冰浮水">沉冰浮水</a></p>
    </div>
  </div>
</footer>
<script src="//cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<script src="//cdn.bootcss.com/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="//cdn.bootcss.com/bootstrap-fileinput/4.3.2/js/fileinput.min.js" type="text/javascript"></script>
<script src="//cdn.bootcss.com/bootstrap-fileinput/4.3.1/js/fileinput_locale_zh.min.js" type="text/javascript"></script>

<script type="text/javascript">
$(function () {
  $("#torrent").fileinput({
    language: 'zh', //设置语言
    uploadUrl: window.location.href + "/get.php", //上传的地址
    allowedFileExtensions: ['jpg', 'png', 'torrent'],//接收的文件后缀
    showPreview: false,
    browseClass: "btn btn-success",
    browseLabel: "选择种子",
    browseIcon: "<i class=\"glyphicon glyphicon-plus\"></i>",
    removeClass: "btn btn-danger",
    removeIcon: "<i class=\"glyphicon glyphicon-trash\"></i>",
    uploadClass: "btn btn-info",
    uploadLabel: "解析",
    uploadIcon: "<i class=\"glyphicon glyphicon-refresh\"></i>",
    initialCaption: "选择文件"
  }).on("fileuploaded", function (event, data, previewId, index) {
        console.log(JSON.stringify(data.response));
        $(".kv-upload-progress").slideUp(1500);
        $(".js-result").html("");
        $(".js-result").append("<p><small>资源名：</small>" + data.response.name + "</p>");
        $(".js-result").append("<p><small>磁力链：</small>" + data.response.magnet + "</p>");
        if(data.response.ed2k)
          $(".js-result").append("<h4>ed2k：</h4><p>" + data.response.ed2k.join("</p><p>") + "</p>");
        $(".js-show").removeClass("hidden").addClass("in");
        let strRlt = "echo \"{sth}\" >> \"{file}\".txt".replace(/{file}/,data.response.name);
        let arrRlt = [];
        $(".js-result > *").each(function(){
          arrRlt.push(strRlt.replace(/{sth}/,$(this).text()));
        });
        arrRlt.push("exit\nexit\n");
        console.log(arrRlt.join("\n"));        
  });
	function randomsort(a, b) {
		return Math.random()> 0.5 ?  - 1 : 1;
	}
	function fnRndItem(a) {
		a = a.sort(randomsort);
		return a[parseInt((a.length) * Math.random())];
	}
  var arrIMGS = [
    "//wx4.sinaimg.cn/mw690/78f2cc43gy1fcxz5zihlqg20iw0lowxq.gif",
    "//wx3.sinaimg.cn/mw690/48ed9e80ly1fectyuvqh7j20k00k0jso.jpg",
    "//wx1.sinaimg.cn/mw690/48ed9e80ly1fecuung6tyj20g40eqgmk.jpg",
  ];
  //alert(fnRndItem(arrIMGS));
  $(".kanna img").attr("src",fnRndItem(arrIMGS));
});
</script>
</body>
</html>